/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package data;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author stana
 */
@Entity
@Table(name = "log_")
@NamedQueries(
{
    @NamedQuery(name = "Log.findAll", query = "SELECT l FROM Log l"),
    @NamedQuery(name = "Log.findById", query = "SELECT l FROM Log l WHERE l.id = :id"),
    @NamedQuery(name = "Log.findByDate", query = "SELECT l FROM Log l WHERE l.date = :date"),
    @NamedQuery(name = "Log.findByLatitude", query = "SELECT l FROM Log l WHERE l.latitude = :latitude"),
    @NamedQuery(name = "Log.findByLongitude", query = "SELECT l FROM Log l WHERE l.longitude = :longitude"),
    @NamedQuery(name = "Log.findBySmsMessage", query = "SELECT l FROM Log l WHERE l.smsMessage = :smsMessage"),
    @NamedQuery(name = "Log.findByErrorMessage", query = "SELECT l FROM Log l WHERE l.errorMessage = :errorMessage")
})
public class Log implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "date_")
    @Temporal(TemporalType.DATE)
    private Date date;
    @Basic(optional = false)
    @Column(name = "latitude")
    private float latitude;
    @Basic(optional = false)
    @Column(name = "longitude")
    private float longitude;
    @Basic(optional = false)
    @Column(name = "sms_message")
    private String smsMessage;
    @Column(name = "error_message")
    private String errorMessage;

    public Log()
    {
    }

    public Log(Integer id)
    {
        this.id = id;
    }

    public Log(Integer id, Date date, float latitude, float longitude, String smsMessage)
    {
        this.id = id;
        this.date = date;
        this.latitude = latitude;
        this.longitude = longitude;
        this.smsMessage = smsMessage;
    }

    public Integer getId()
    {
        return id;
    }

    public void setId(Integer id)
    {
        this.id = id;
    }

    public Date getDate()
    {
        return date;
    }

    public void setDate(Date date)
    {
        this.date = date;
    }

    public float getLatitude()
    {
        return latitude;
    }

    public void setLatitude(float latitude)
    {
        this.latitude = latitude;
    }

    public float getLongitude()
    {
        return longitude;
    }

    public void setLongitude(float longitude)
    {
        this.longitude = longitude;
    }

    public String getSmsMessage()
    {
        return smsMessage;
    }

    public void setSmsMessage(String smsMessage)
    {
        this.smsMessage = smsMessage;
    }

    public String getErrorMessage()
    {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage)
    {
        this.errorMessage = errorMessage;
    }

    @Override
    public int hashCode()
    {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object)
    {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Log))
        {
            return false;
        }
        Log other = (Log) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id)))
        {
            return false;
        }
        return true;
    }

    @Override
    public String toString()
    {
        return "data.Log[id=" + id + "]";
    }

}
